<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name = "format-detection" content="telephone = no" />
<title>{$config_sitename}</title>
<meta name="description" content="">
<meta name="keywords" content="">
<link href="__CSS__/trypp.css" rel="stylesheet">
<style>
    .try-det-img img {
    	width: 100%;
    	height: auto;
    }
</style>
</head>
<body class="body-pad cl-b-lgrey sy-list-wrapper try-detail-wrapper no-foot">
	<div class="loading-wrapper">
		<div class="loading"></div>
	</div>
	<div class="ub ub-ac page-header">
		<a href="javascript:history.back();" class="clickable"><span class="icon-back"></span></a>
		<div class="ub-f1 page-name">试用详情</div>
		<a href="{:U('Index/index')}" class="clickable"><span class="icon-index"></span></a>
		<!--  <a href="{:U('Try/reportlist')}" class="clickable-deep"><span class="icon-shiyong"></span></a>-->
	</div>
	<div class="dongtai-item cl-b-white row clickable">
		<div class="ub ub-ac">
			<div class="dongtai-img lazy" data-original="{$info.image}"><img src="__IMAGES__/o7.png" class="oimg"></div>
			<div class="ub-f1 dongtai-text">
				<h3 class="cl-f-dgrey f14 text-overflow">{$info.title}</h3>
				<p class="dongtai-article cl-f-lgrey f12 text-overflow">{$info.requestnum}人申请 剩余{$info.trynum}份</p>
				<p class="dongtai-article cl-f-lgrey f12 text-overflow">时间剩余：{$info.end_time|stime}</p>
				<if condition="$count eq 0">
				<span class="dongtai-status cl-b-lorange cl-f-white f12 request-js" data-type="yes">立即申请</span>
				<else/>
				<span class="dongtai-status cl-b-lorange cl-f-white f12" style="background-color: #ccc;" data-type="yes">已提交申请</span>
				</if>
			</div>
		</div>
	</div>
	<div class="try-det-img cl-b-white row">
		{$info.content}
	</div>
	
	
	<script>
	
	var img_url = "__IMAGES__"; 
	
	</script>
	
	<script src="__JS__/jquery-1.11.1.min.js"></script>
	<script src="__JS__/jquery.lazyload.min.js"></script>
    <script src="__JS__/custom.js?t=201601111050"></script>
    <script src="__JS__/common.js?t=201601111050"></script>
    <script>

    
    
    $(function(){
        $('.request-js').click(function(e){
            e.preventDefault();
            var _this = $(this);
            var tryid = {$info.tryid};
            var type = _this.attr('data-type');
            if(type == 'yes')
            {
                _this.attr('data-type');
                $.ajax({
                    url: '/weixin/try/sendTry',
                    type: 'GET',
                    dataType: 'json',
                    data: {
                        tryid: tryid
                    },
                    success: function(res){
                        showToast(res.info);
                        if(res.status == 1)
                        {
                            _this.removeClass('request-js').text('已提交申请');
                        }
                        _this.attr('data-type', 'yes');
                    },
                    error: function(res){
                        showToast('系统繁忙');
                        _this.attr('data-type', 'yes');
                    }
                });
            }
            else
            {
                showToast('申请中');
            }
        });
    });
    </script>
</body>
</html>